package View;

import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.Tooltip;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.paint.Color;
import javafx.stage.StageStyle;

import java.io.IOException;

public class CreateGroupWindow extends window {
    public CreateGroupWindow () throws IOException {
        root = FXMLLoader.load(getClass().getResource("/Fxml/createGroup.fxml"));
        Scene scene = new Scene(root, 474, 400);
        scene.setFill(Color.TRANSPARENT);
        setScene(scene);
        initStyle(StageStyle.TRANSPARENT);
        setResizable(false);
        setTitle("We Chat");
        Image image=new Image("/Picture/sourceMaterial/建群背景图.jpg",474,400,false,false);
        ((ImageView)$("backgroundImage")).setImage(image);
        move();
        quit();
        setIcon();
        minimiser();
    }


    //退出
    @Override
    public void quit() {
        ((Button) $("exitButton")).setTooltip(new Tooltip("退出"));
        ((Button) $("exitButton")).setOnAction(event -> {
            close();
        });

    }
    //最小化
    @Override
    public void minimiser() {
        ((Button) $("ministerButton")).setTooltip(new Tooltip("最小化"));
        ((Button) $("ministerButton")).setOnAction(event -> {
            setIconified(true);
        });
    }
    public void clear(){
        ((Label)$("accountTip")).setText("");
        ((Label)$("nameTip")).setText("");
    }
}
